package com.ellwood.IPGuard.common.core.result;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @ProjectName: IPGuard-boot
 * @PackageName: com.ellwood.IPGuard.common.core.result
 * @ClassName: EllPageResult
 * @Description: // 分页返回结果
 * @Author: Ellwood
 * @CreateDate: 2024/9/25 - 下午4:19
 * @Version: V1.0.0
 */
@Data
@Schema(description = "分页返回结果")
public class EllPageResult<T> implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "总记录数")
    private int total;

    @Schema(description = "列表数据")
    private List<T> list;
        
        /**
         * 分页
         *
         * @param list  列表数据
         * @param total 总记录数
         */
        public EllPageResult(List<T> list, long total) {
                this.list = list;
                this.total = (int) total;
        }

}
